// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2

package svc

import (
	"gorm.io/gorm"
	"zero_study/common/common/init_db"
	"zero_study/model_study/user_gorm/api/internal/config"
)

type ServiceContext struct {
	Config config.Config
	Db     *gorm.DB
}

func NewServiceContext(c config.Config) *ServiceContext {
	// 数据库 初始化
	db := init_db.InitGorm(c.Mysql.DataSource)
	return &ServiceContext{
		Config: c,
		//配置
		Db: db,
	}
}
